package com.ruoyi.scient.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.scient.mapper.ScientLectureMapper;
import com.ruoyi.scient.domain.ScientLecture;
import com.ruoyi.scient.service.IScientLectureService;

/**
 * 讲座申请Service业务层处理
 * 
 * @author zhangcong
 * @date 2025-11-03
 */
@Service
public class ScientLectureServiceImpl implements IScientLectureService 
{
    @Autowired
    private ScientLectureMapper scientLectureMapper;

    /**
     * 查询讲座申请
     * 
     * @param id 讲座申请主键
     * @return 讲座申请
     */
    @Override
    public ScientLecture selectScientLectureById(Long id)
    {
        return scientLectureMapper.selectScientLectureById(id);
    }

    /**
     * 查询讲座申请列表
     * 
     * @param scientLecture 讲座申请
     * @return 讲座申请
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<ScientLecture> selectScientLectureList(ScientLecture scientLecture)
    {
        return scientLectureMapper.selectScientLectureList(scientLecture);
    }

    /**
     * 新增讲座申请
     * 
     * @param scientLecture 讲座申请
     * @return 结果
     */
    @Override
    public int insertScientLecture(ScientLecture scientLecture)
    {
        scientLecture.setCreateTime(DateUtils.getNowDate());
        return scientLectureMapper.insertScientLecture(scientLecture);
    }

    /**
     * 修改讲座申请
     * 
     * @param scientLecture 讲座申请
     * @return 结果
     */
    @Override
    public int updateScientLecture(ScientLecture scientLecture)
    {
        return scientLectureMapper.updateScientLecture(scientLecture);
    }

    /**
     * 批量删除讲座申请
     * 
     * @param ids 需要删除的讲座申请主键
     * @return 结果
     */
    @Override
    public int deleteScientLectureByIds(Long[] ids)
    {
        return scientLectureMapper.deleteScientLectureByIds(ids);
    }

    /**
     * 删除讲座申请信息
     * 
     * @param id 讲座申请主键
     * @return 结果
     */
    @Override
    public int deleteScientLectureById(Long id)
    {
        return scientLectureMapper.deleteScientLectureById(id);
    }
}
